package mbsl.extensions;

import mbsl.system.Core;

/**
 * All extensions need to implement this interface.
 * <p>
 * Extensions are <i>last</i> in the loading order (but finishes before the UI
 * is spawned), and are thus free to bind themselves to any main component. The
 * likely most interesting component is the MainController, which acts as the
 * gateway to the rest of the UI. Core also provides database access through
 * Hibernate.
 */
public interface Extension {
	/**
	 * This method will be called during setup, to allow extensions to add
	 * parameters to the database for example.
	 */
	public void init(Core core);
	/**
	 * This method will be sent to each extension when loading it. The Core
	 * object is the gateway to the rest of the application.
	 */
	public void start(Core core);
	/**
	 * This method will be sent to each extension when the application is
	 * shutting down.
	 */
	public void shutdown(Core core);
	/**
	 * A list of modules that needs to be loaded before this one, for example
	 * for dependency reasons.
	 * <p>
	 * The module names must be qualified names of the classes that implement
	 * Extension.
	 * <p>
	 * If the module has no such requirements, it can return an empty list,
	 * or null.
	 */
	public String[] loadAfter();
}
